//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core;

namespace OpenLS.Spreadsheet
{
    class InsertDimensionUndoUnit<T>: IUndoUnit where T: Dimension
    {
        public InsertDimensionUndoUnit(DimensionCollection<T> c, int index)
        {
            Owner = c;
            Index = index;
        }

        readonly DimensionCollection<T> Owner;
        readonly int Index;

        #region IUndoUnit Members

        public void Do()
        {
            Owner.Worksheet.DeleteExistingDimension(Owner[Index]);
        }

        public bool Merge(IUndoUnit unit)
        {
            return false;
        }

        #endregion
    }
}
